<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">
	
	<ui:composition template="/pages/layout/mainLayout.xhtml">
		<ui:define name="bodyComUsuario">
	
			<div class="post">
				<h2 class="title"><h:outputText value="#{bundle['locanet.cliente.cadastro.titulo']}" /></h2>
				<h:form>
					<p:panel header="#{bundle['locanet.dadosPessoais']}">
						<h:panelGrid columns="3">
							<h:outputLabel for="nomeCliente"
								value="#{bundle['locanet.pessoa.nome']}" />
							<h:inputText id="nomeCliente" maxlength="255"
								value="#{clienteBean.entity.nome}" />
							<h:messages for="nomeCliente" styleClass="error" />
				
							<h:outputLabel for="cpfCliente"
								value="#{bundle['locanet.cliente.cpf']}" />
							<h:inputText id="cpfCliente" maxlength="11"
								value="#{clienteBean.entity.cpf}">
								<f:ajax execute="@this" render="mensagemCpfCliente" action="blur" />
								<f:validator validatorId="cpfValidator" />
							</h:inputText>
							<h:messages for="cpfCliente" id="mensagemCpfCliente"
								styleClass="error" />
				
						</h:panelGrid>
					</p:panel>
					
					<p:panel header="#{bundle['locanet.dadosResidenciais']}">
						<h:panelGrid columns="3">
							<h:outputLabel for="enderecoCliente"
								value="#{bundle['locanet.cliente.endereco']}" />
							<h:inputText id="enderecoCliente" maxlength="255"
								value="#{clienteBean.entity.endereco}" />
							<h:messages for="enderecoCliente" styleClass="error" />
				
							<h:outputLabel for="cepCliente"
								value="#{bundle['locanet.cliente.cep']}" />
							<h:inputText id="cepCliente" maxlength="8"
								value="#{clienteBean.entity.cep}" />
							<h:messages for="cepCliente" styleClass="error" />
				
							<h:outputLabel for="telefoneResCliente"
								value="#{bundle['locanet.cliente.telRes']}" />
							<h:inputText id="telefoneResCliente" maxlength="10"
								value="#{clienteBean.entity.telefone_res}" />
							<h:messages for="telefoneResCliente" styleClass="error" />
				
							<h:outputLabel for="telefoneCelCliente"
								value="#{bundle['locanet.cliente.telCel']}" />
							<h:inputText id="telefoneCelCliente" maxlength="10"
								value="#{clienteBean.entity.telefone_cel}" />
							<h:messages for="telefoneCelCliente" styleClass="error" />
						</h:panelGrid>
					</p:panel>
					
					<p:panel header="#{bundle['locanet.dadosAcessoSistema']}">
						<h:panelGrid columns="3">
							<h:outputLabel for="loginCliente"
								value="#{bundle['locanet.pessoa.login']}" />
							<h:inputText id="loginCliente"
								onblur="validateClienteLogin(getById('trLoginCliente'),this.value)"
								value="#{clienteBean.entity.login}" maxlength="20">
								<f:ajax render="mensagemLoginCliente" action="blur" execute="@this" />
							</h:inputText>
							<h:messages for="loginCliente" id="mensagemLoginCliente"
								styleClass="error" />
				
							<h:outputLabel for="senhaCliente"
								value="#{bundle['locanet.pessoa.senha']}" />
							<h:inputSecret id="senhaCliente" maxlength="20"
								value="#{clienteBean.entity.senha}" />
							<h:messages for="senhaCliente" styleClass="error" />
				
							<h:outputLabel for="confSenhaCliente"
								value="#{bundle['locanet.pessoa.confSenha']}" />
							<h:inputSecret id="confSenhaCliente" maxlength="20"
								value="#{clienteBean.conf_senha}" />
							<h:messages for="confSenhaCliente" styleClass="error" />
						</h:panelGrid>
					</p:panel>
					
					<p:panel>
						<h:commandButton action="#{clienteBean.insert}"
							value="#{bundle['locanet.butoes.cadastrar']}" />
					</p:panel>
				</h:form>
			</div>
		</ui:define>
	</ui:composition>
</html>